import request from '@/router/axios';

// 列表
export const getList = (current, size, params) => {
  return request({
    url: '/api/ManageClass/GetClassList',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

export const getDetail = (id) => {
  return request({
    url: '/api/ManageClass/GetClassInfo',
    method: 'get',
    params: {
      id
    }
  })
}

// 删除
export const remove = (params) => {
  return request({
    url: '/api/ManageClass/DelClass',
    method: 'post',
    data:params
    // params: {
    //   ids,
    // }
  })
}

// 添加
export const add = (row) => {
  return request({
    url: '/api/ManageClass/AddOrEditClass',
    method: 'post',
    data: row
  })
}

// 修改
export const update = (row) => {
  return request({
    url: '/api/ManageClass/AddOrEditClass',
    method: 'post',
    data: row
  })
}

// 生成班级码
export const createClassQr = (row) => {
  return request({
    url: '/api/ManageClass/CreateClassQr',
    method: 'post',
    data: row
  })
}

// 左侧树
export const getBjTree = (params) => {
  return request({
    url: '/api/ManageClass/GetLeftHandTree',
    method: 'get',
    params: {
      ...params,
    }
  })
}

export const schoolClass = (params) => {
  return request({
    url: '/api/ManageClass/GetGradeSelect',
    method: 'get',
    params: {
      ...params,
    }
  })
}

